<?php
Zend_Loader::loadFile('../application/default/models/Common.php');
class Form_blogform extends Zend_Form
{
    public function __construct($options=array())
    {
        parent::__construct($options);

     
        $this->setMethod('post');
        if($options["action"]=="add" || $options["action"]=="doadd")
        {
             $this->setAction('/blog/doadd/');
        }
        else{
            $this->setAction('/blog/doedit/');
        }
        
        $this->addPrefixPath('AML_Form_Element', '../library/Form/Element/', 'element');

     	$title = new Zend_Form_Element_Text('title');
        $title ->setLabel('Title* :')
          ->setRequired(true)
          ->setAllowEmpty(false)
          ->setOptions(array('class'=>'input-2'));
           $this->addElement($title);

        
       
          $this->addElement('text', 'alias', array(
        'label'      => 'Alias:',
        'filters'    => array('StringTrim'),
        'class'			 => 'input-2',
        'validators' => array(
        array('validator' => 'StringLength', 'options' => array(0, 50)),
        
        )
        ));

          

        /*   	$hotel_facility_en = $this ->addElement('Lion_Form_Element', 'hotel_facility_en',
    				array('label' =>'Facilities(english):',
    					'validators' =>array(
    					array('validator' =>'StringLength', 'options' =>array(0, 1000))
    				),
		)); 
*/
      $this->addElement('textarea','full_text', array('label' => 'Article Text', 'rows' => '5' ));
      
      	$this->addElement('formRTE', 'full_text',
    				array('label' =>'Article Description',
    					'validators' =>array(
    					array('validator' =>'StringLength', 'options' =>array(0, 1000))
    				),
		));
      
     
      	$catid = new Zend_Form_Element_Select('catid');
        $catid ->setLabel('Category* :')
          ->setRequired(true)
		 			 ->addMultiOptions(array(
		 			    '' => 'Select Status',
						1 => 'cat1',
						0 => 'cat2'));
		$catid->setOptions(array('class'=>'input-2'));
		$this->addElement($catid);

      $this->addElement('text', 'created_by_alias', array(
        'label'      => 'Author Alias:',
        'filters'    => array('StringTrim'),
        'class'			 => 'input-2',
        'validators' => array(
        array('validator' => 'StringLength', 'options' => array(0, 50))
        )
        ));

      $state = new Zend_Form_Element_Select('state');
        $state ->setLabel('Status')
		 			 ->addMultiOptions(array(
		 			    '' => 'Select Status',
						1 => 'Published',
						0 => 'Unpublished'));
		$state->setOptions(array('class'=>'input-2'));
		$this->addElement($state);

       $this->addElement('text', 'publish_up', array(
        'label'      => 'Start Publish:',
        'filters'    => array('StringTrim'),
        'class'			 => 'input-2',
        'validators' => array(
        array('validator' => 'StringLength', 'options' => array(0, 50))
        )
        ));

         $this->addElement('text', 'publish_down', array(
        'label'      => 'End Publish:',
        'filters'    => array('StringTrim'),
        'class'			 => 'input-2',
        'validators' => array(
        array('validator' => 'StringLength', 'options' => array(0, 50))
        )
        ));

          $access = new Zend_Form_Element_Select('access');
        $access ->setLabel('Access')
		 			 ->addMultiOptions(array(
		 			    '' => 'Select Status',
						1 => 'Private',
						0 => 'Public'));
		$access->setOptions(array('class'=>'input-2'));
		$this->addElement($access);


             $this->addElement('textarea','metadesc', array('label' => 'Meta Description', 'rows' => '5' ));

                 $this->addElement('textarea','metakey', array('label' => 'keywords', 'rows' => '5' ));



      $this->addElement('submit', 'save', array(
        'label'      => 'Save:',
        'filters'    => array('StringTrim'),
        'class'			 => 'input-2',
        'validators' => array(
        array('validator' => 'StringLength', 'options' => array(0, 50))
        )
        ));

       $this->addElement('hidden', 'id', array(
        'label'      => 'End Publish:',
        'filters'    => array('StringTrim'),
        'class'			 => 'input-2',
        'validators' => array(
        array('validator' => 'StringLength', 'options' => array(0, 50))
        )
        ));


}

		
 

    
}
